{extend name="index/index" /}

<!--main-->
{block name="main"}
                <div class="main-content">
                    <div class="breadcrumbs" id="breadcrumbs">
                        <script type="text/javascript">
                            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
                        </script>

                        <ul class="breadcrumb">
                            <li>
                                <i class="icon-home home-icon"></i>
                                <a href="#">Home</a>
                            </li>

                            <li>
                                <a href="/category">广告管理</a>
                            </li>
                            <li class="active">上传广告图片</li>
                        </ul><!-- .breadcrumb -->

                        <div class="nav-search" id="nav-search">
                            <form class="form-search">
                                <span class="input-icon">
                                    <input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
                                    <i class="icon-search nav-search-icon"></i>
                                </span>
                            </form>
                        </div><!-- #nav-search -->
                    </div>

                    <div class="page-content">
                        <div class="page-header">
                        </div><!-- /.page-header -->











                        <div class="row">
                            <div class="col-xs-12">
                                <!-- PAGE CONTENT BEGINS -->

                                <form class="form-horizontal" role="form" action='/doup' method='post' enctype='multipart/form-data'>
                                    <div class="space-4"></div>
                                    <input type="hidden" name = 'aid' value='{$list["id"]}'>
                                    <!-- name -->
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label no-padding-right">Adv_Name :</label>

                                        <div class="col-sm-9">
                                            <span class="input-icon" id='check'>
                                                <input type="text"  name='name' value='{$list["name"]}' readonly/>
                                                <i class=" icon-book blue"></i>
                                                <span ><font color='#0f0'></font></span>
                                            </span>
                                        </div>
                                    </div>

                                    <!-- icon -->
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label no-padding-right">up :</label>

                                        <div class="col-sm-9">
                                            <span  >
                                                <input type="file"  name='myfile[]' multiple="multiple" />
                                                                                    
                                            </span>
                                        </div>
                                    </div>

                                    <div class="clearfix form-actions">
                                        <div class="col-md-offset-3 col-md-9">
                                            <button class="btn btn-info" type="submit">
                                                <i class="icon-ok bigger-110"></i>
                                                提交
                                            </button>

                                            &nbsp; &nbsp; &nbsp;
                                            <button class="btn" type="reset">
                                                <i class="icon-refresh bigger-110"></i>
                                                重置
                                            </button>

                                            &nbsp; &nbsp; &nbsp;
                                            <a href='/advertisement' class="btn btn-warning" type="reset">
                                                <i class="icon-undo bigger-110"></i>
                                                返回
                                            </a>
                                        </div>
                                    </div>
                                </form>

                                    <div class="hr hr-24"></div>

 
                            </div><!-- /.col -->
                        </div><!-- /.row -->
                    </div><!-- /.page-content -->
                </div><!-- /.main-content -->
{/block}


<!-- basic scripts -->

<!--[if !IE]> -->

<script src="/static/admin/js/jquery.min.js"></script>

<!-- <![endif]-->

{block name="myjs" }
<!--[if IE]>
<script src="/static/admin/js/1.10.2/jquery.min.js"></script>
<![endif]-->

<!--[if !IE]> -->

<script type="text/javascript">
    window.jQuery || document.write("<script src='/static/admin/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='/static/admin/js/jquery-1.10.2.min.js'>" + "<" + "/script>");
</script>
<![endif]-->

<script type="text/javascript">
    if ("ontouchend" in document) document.write("<script src='/static/admin/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
</script>
<script src="/static/admin/js/bootstrap.min.js"></script>
<script src="/static/admin/js/typeahead-bs2.min.js"></script>

<!-- page specific plugin scripts -->

<script src="/static/admin/js/jquery.dataTables.min.js"></script>
<script src="/static/admin/js/jquery.dataTables.bootstrap.js"></script>

<!-- ace scripts -->

<script src="/static/admin/js/ace-elements.min.js"></script>
<script src="/static/admin/js/ace.min.js"></script>

<!-- inline scripts related to this page -->

<script type="text/javascript">
    ip.onfocus=function(){
        tip.innerHTML = '注意不要重名了哦~';
    }
    ip.onblur=function(){
        var name = ip.value;
        // console.log(name);
        check(name);
    }

    function check(name){
        $.ajax({
            type:'get',
            dataType:'json',
            data:{'name':name},
            url:'/checkcatename/',
            success:function(data){
                // console.log(data);
                if (data) {
                    tip.innerHTML = '<font color="red">'+'名字已存在,亲~换一个吧~~'+'</font>';
                }else{
                    // console.log(ip.value);
                    if (ip.value == '') {
                        tip.innerHTML = '<font color="red">'+'不能为空哦~'+'</font>';
                    }else{
                    tip.innerHTML = '<i class="icon-check">'+'</i>';
                    }
                }
                // console.log(data);
                // myModalLabel.innerHTML='编辑 '+ data['name'] +' 的分类';
            },
            error:function(){
                alert('ajax执行失败');
            },
        });
    }

    jQuery(function ($) {
        var oTable1 = $('#sample-table-2').dataTable({
            "aoColumns": [
                {"bSortable": false},
                null, null, null, null, null,
                {"bSortable": false}
            ]
        });


        $('table th input:checkbox').on('click', function () {
            var that = this;
            $(this).closest('table').find('tr > td:first-child input:checkbox')
                .each(function () {
                    this.checked = that.checked;
                    $(this).closest('tr').toggleClass('selected');
                });

        });


        $('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
        function tooltip_placement(context, source) {
            var $source = $(source);
            var $parent = $source.closest('table')
            var off1 = $parent.offset();
            var w1 = $parent.width();

            var off2 = $source.offset();
            var w2 = $source.width();

            if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) return 'right';
            return 'left';
        }
    })

</script>
{/block}

<div style="display:none">
    <script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script>
</div>
</body>
</html>
